package Logica;

public abstract class CodigoBarra {

	public static String getBarra (String barra){
		System.out.println("ENTRO A CODIGOBARRA.JAVA");
		int primero = barra.indexOf("(");
		int segundo = barra.indexOf(")");
		int guion = barra.indexOf("-");
		System.out.println("barra original: "+barra);
		if(primero >= 0 || segundo > primero){
			barra = barra.substring(segundo+1, barra.length());
		}
		if(guion > 0){
			barra = barra.substring(guion+4, barra.length());
		}
		System.out.println("barra editado: "+barra);
		return barra;		
	}
	
	
	public static void main(String[] args) {
		String s = "(uac-8)123426367";
		System.out.println(s+": "+getBarra(s));
		s= "(uaasfasfasdfasdfasdf)123426367";
		System.out.println(s+": "+getBarra(s));
		s= "(uac-8)12adsfasfasfasdfs3426367";
		System.out.println(s+": "+getBarra(s));
		s="()123426367";
		System.out.println(s+": "+getBarra(s));
		s="(           )123426367";
		System.out.println(s+": "+getBarra(s));
		s="(asfdasdfasf    asfasfasdf)123asdfasf    sadasfas 426367";
		System.out.println(s+": "+getBarra(s));
		s= "uac-8)123426367";
		System.out.println(s+": "+getBarra(s));
		s="123426367";
		System.out.println(s+": "+getBarra(s));
//		
//		System.out.println();
//		System.out.println();
//		System.out.println();
		

	}

}
